Skip to content

fix: skip destination transforms for explicit member maps (#952, ctor path)#966

Open
leno23 wants to merge 2 commits into
MapsterMapper:developmentfrom
leno23:fix/explicit-null-map-952-dev
Open

fix: skip destination transforms for explicit member maps (#952, ctor path)#966
leno23 wants to merge 2 commits into
MapsterMapper:developmentfrom
leno23:fix/explicit-null-map-952-dev

Conversation

@leno23
Copy link
Copy Markdown

@leno23 leno23 commented May 25, 2026

Summary

  • Explicit .Map(...) configuration now takes precedence over global DestinationTransform rules such as EmptyCollectionIfNull
  • Prevents explicit null member mappings from being overridden by collection transforms

Fixes #952

Test plan

  • CI passes (WhenPerformingDestinationTransforms.Explicit_Null_Mapping_Is_Not_Overridden_By_EmptyCollectionIfNull)

…per#952)

Explicit .Map(...) configuration should take precedence over global
DestinationTransform rules such as EmptyCollectionIfNull.

Co-authored-by: Cursor <cursoragent@cursor.com>
…erMapper#943, MapsterMapper#952)

Do not apply EmptyCollectionIfNull when a member has an explicit Map
resolver, including record constructor parameters.

Co-authored-by: Cursor <cursoragent@cursor.com>
@leno23
Copy link
Copy Markdown
Author

leno23 commented May 27, 2026

Updated 8b8898a: merged ctor-path fix from former #973ApplyDestinationTransform on record/class ctor args + explicit .Map skip in ApplyNullPropagationFromCtor. Added Explicit_Null_Record_Ctor_Mapping_Is_Not_Overridden_By_EmptyCollectionIfNull alongside existing property-map regression (#952). Covers both adapter and ctor instantiation paths.

@leno23 leno23 changed the title fix: skip destination transforms for explicit member maps (#952) fix: skip destination transforms for explicit member maps (#952, ctor path) May 27, 2026
@leno23
Copy link
Copy Markdown
Author

leno23 commented May 27, 2026

CI note: latest push 8b8898a — workflow still action_required (fork). Once Build and Test is approved, this covers both paths:\n- property mapping (BaseAdapter)\n- record/class ctor args (BaseClassAdapter + ApplyDestinationTransform)\n\nBuilds on #945 (#943) already on development.

@leno23
Copy link
Copy Markdown
Author

leno23 commented May 27, 2026

Batch ping: #966, #970, #971, #976, #979 (and other open fork PRs) are rebased on latest development (11853b3) and mergeable — all waiting on maintainer Build and Test workflow approval. Happy to address review feedback once CI runs.

@leno23
Copy link
Copy Markdown
Author

leno23 commented May 27, 2026

Open fork PRs (2026-05-27) — all rebased on development (11853b3), mergeable, awaiting Build and Test workflow approval:

PR Type
#979 test (#938 UseDestinationValue)
#966 fix (#952 + ctor)
#970 fix (#900 MapToTarget)
#971 fix (#898 ProjectToType)
#976 fix (#947 MapWith cast)
#977 fix (#801 projection Include)
#965, #972 test-only

Happy to address review feedback once CI runs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant